
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dominio.Entidades;


import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

import java.io.*;

/**
 *
 * @author 187882
 */
public class ArchivoGrabacion {
    private BufferedWriter out;

    
    public ArchivoGrabacion(String unNombre) {
        try {
            out = new BufferedWriter(new FileWriter(unNombre));
        } catch (IOException e) {

            System.out.println("no se puede crear");
        }
    }

    
    
    
    public boolean grabarLinea(String linea) {
        boolean ok = true;

        try {
            out.write(linea);
            out.newLine();
        } catch (IOException e) {
            ok = false;
        }
        return ok;
    }

    
    
    
    public boolean cerrar() {
        boolean ok = true;

        try {
            out.flush();
            out.close();
        } catch (Exception e) {
            ok = false;
        }
        return ok;
    }




}
